﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BlobNet.Base
{
    /// <summary>
    /// Indicates a relation between two BlobParts
    /// Indicating only in one of the components of the relation is enough when indicating in both sides ensure the correctnes of the relation with the other side's definition
    /// </summary>
    [AttributeUsage(AttributeTargets.Property,AllowMultiple=false)]
    public class BlobPartRelationAttribute: Attribute
    {
        public enum RelationType:int
        {
            OneToOne=1,
            OneToMany,
            ManyToOne,
            ManyToMany

        }

        /// <summary>
        /// Unique identifier for the relationship
        /// It must be in both sides of the relationship
        /// </summary>
        public Guid RelationUniqueIdentifier { get; set; }

        public Type TheOtherSideType { get; set; }
        public string TheOtherSideProperty { get; set; }
        public RelationType RelationFromThisSide { get; set; }

    }
}
